home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SNIP0492.ARJ / FOSSIL.H < prev    next >
C/C++ Source or Header  |  1991-09-23  |  2KB  |  79 lines

  1. /*
  2. **  fossil.h -- declarations for fossil interface
  3. **
  4. **  public domain by Martin Maney
  5. **
  6. **   29 Dec 89   added C++ wrapper
  7. **   14 Dec 89   names revised
  8. **   17 Jul 89   1st cut: minimal support for a few functions
  9. */
  10.  
  11. #if !defined(__FOSSIL_H__)
  12. #define __FOSSIL_H__
  13.  
  14. #if defined(__cplusplus)
  15.   extern "C" {
  16. #endif
  17.  
  18. /*
  19. ** symbols for supported baud rates & other parameters, use with
  20. ** port_setbaud().  All of these are compatible with the standard
  21. ** BIOS except B19200 and B38400, which use codes assigned to 110
  22. ** and 150 baud by the BIOS.
  23. */
  24.  
  25. #define B300 (2 << 5)
  26. #define B600 (3 << 5)
  27. #define B1200 (4 << 5)
  28. #define B2400 (5 << 5)
  29. #define B4800 (6 << 5)
  30. #define B9600 (7 << 5)
  31. #define B19200 (0 << 5)
  32. #define B38400 (1 << 5)
  33.  
  34. #define PARITY_NONE 0
  35. #define PARITY_EVEN (3<<3)
  36. #define PARITY_ODD (1<<3)
  37.  
  38. #define STOPBITS_1 0
  39. #define STOPBITS_2 (1<<2)
  40.  
  41. #define DATABITS_7 2
  42. #define DATABITS_8 3
  43.  
  44. #define FC_NONE 0
  45. #define FC_XMT_XON 1
  46. #define FC_DTR 2
  47. #define FC_RCV_XON 8
  48.  
  49.  
  50. /*
  51. ** bit masks for port status (returned by portStatus(), etc)
  52. */
  53.  
  54. #define PS_RDA (1 << 8)
  55. #define PS_OVRN (1 << 9)
  56. #define PS_THRE (1 << 13)
  57. #define PS_TSRE (1 << 14)
  58. #define PS_DCD (1 << 7)
  59.  
  60.  
  61. /*
  62. ** prototypes
  63. */
  64.  
  65. void pascal port_setBaud(int port, int baud);
  66. int pascal port_open(int port);
  67. int pascal port_close(int port);
  68. void pascal port_flow(int port, int mode);
  69. void pascal port_dtr(int port, int enable);
  70. int pascal port_status(int port);
  71. int pascal port_read(int port, char *buf, int n);
  72. int pascal port_write(int port, const char *buf, int n);
  73.  
  74. #if defined(__cplusplus)
  75.   }
  76. #endif
  77.  
  78. #endif  /* __FOSSIL_H__ */
  79.